package com.lin.springcloud.service;

import com.lin.springcloud.entities.CommonResult;
import com.lin.springcloud.entities.Payment;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author Created by Lin Weihong
 * @date on 2022/4/2 20:01
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE") //Eureka上面的微服务名称
public interface PaymentFeignService {
    @GetMapping("/payment/get/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable(value = "id") Long id);

    @GetMapping("/payment/feign/timeout")//默认等待一秒钟
    String paymentTimeOut(); //返回类型要与服务端接口一致
}
